const mongoose = require("mongoose")
const Schema = mongoose.Schema
const style_item = new Schema({
    language: {
        type: String,
        default: ""
    },
    genre: {
        type: String,
        default: ""
    }
})
const Music_type = {
    musicname: {
        type: String,
        default: "",
        required: [true, '必填标题'],
    },
    singer: {
        type: String,
        default: "",
        required: [true, '必填歌手'],
    },
    Music_type: {
        type: String,
        default: "0",
        required: [true, '必填类型'],
    },
    Music_img: {
        type: String,
        default: "/images/user/default.png",

    },
    style: {
        type: Object,
        style_item: style_item,
        required: [true, '必填类型'],
    },
    local_address: {
        type: String,
        default: ""
    },
    network_address: {
        type: String,
        default: ""
    },
    publish_time: {
        type: Number,
        default: Date.now()
    }
}
const MusicModel = mongoose.model('music', new Schema(Music_type))

module.exports = MusicModel